package com.donleo.ssm.service.impl;

import com.donleo.ssm.dao.IRoleMapper;
import com.donleo.ssm.model.RoleModel;
import com.donleo.ssm.service.IRoleService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 * @author liangd
 * date 2020-11-24 15:19
 * code
 */
@Service("roleService")
public class RoleServiceImpl implements IRoleService {

    @Resource
    private IRoleMapper roleMapper;

    @Override
    public Integer add(RoleModel roleModel) {
        roleModel.setCreateTime(new Date());
        return roleMapper.add(roleModel);
    }

    @Override
    public Integer delete(Integer id) {
        return roleMapper.delete(id);
    }

    @Override
    public Integer deletes(List<Integer> idList) {
        return roleMapper.deletes(idList);
    }

    @Override
    public Integer update(RoleModel roleModel) {
        roleModel.setUpdateTime(new Date());
        return roleMapper.update(roleModel);
    }

    @Override
    public RoleModel findById(Integer id) {
        return roleMapper.findById(id);
    }

    @Override
    public List<RoleModel> findAll(RoleModel roleModel) {
        return roleMapper.findAll(roleModel);
    }

    @Override
    public Integer getCount(RoleModel roleModel) {
        return roleMapper.getCount(roleModel);
    }
}
